/* 
 *  Functions
 *
 *  Functions is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  Foobar is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY ); without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 **********************************************************************************
 *  WARNING: THIS CODE WAS GENERATED DO NOT MODIFY, CHANGE THE XSD INSTEAD
 *  Generated by schema2code on Tue Jun 14 15:34:00 2016.
 **********************************************************************************
 *  Copyright 2010
 *
 */

#ifndef __FUNCTIONS_H__
#define __FUNCTIONS_H__

#include <QObject>
#include <QXmlStreamReader>
#include <QString>
#include <QDateTime>

namespace ivef {

//! replace characters that are illigal in XML with their encodings
//!
//! \return     QString
QString encode(const QString& str);

//! convert date time to string (faster than the QDateTime::toString)
//!
//! \return     QString
QString dateToString( const QDateTime& dateTime );

//-----------------------------------------------------------
//! \brief      Overload QXmlStreamReader to create a validation
//!             error and continue parsing (what raiseError does)
//!
class XmlStreamReader: public QObject,
                       public QXmlStreamReader
{
Q_OBJECT

public:
    XmlStreamReader() : QXmlStreamReader() {}
    virtual ~XmlStreamReader() {}

    void validationError(const QString& errorStr);

signals:
    void signalValidationError(const QString& errorStr);
};
} //end ns

#endif
